package baseweb.springbootweb.mapper;

import baseweb.springbootweb.pojo.Emp;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;
import java.util.List;


/**
 * 员工管理
 */
@Mapper
public interface EmpMapper {


    public List<Emp> list(String name, Short gender ,LocalDate begin,LocalDate end);

    public void delete(List<Integer> ids);


    @Insert("insert into emp(username, name, gender, image, job, entrydate, dept_id, create_time, update_time) " +
            "values (#{username},#{name},#{gender},#{image},#{job},#{entrydate},#{deptId},#{createTime},#{updateTime})")
    public void insert(Emp emp);


    @Select("select * from emp where id=#{id}")
    public Emp get(Integer id);

    @Update("update emp set username=#{username},name=#{name},gender=#{gender},image=#{image},job=#{job},entrydate=#{entrydate},dept_id=#{deptId} where id=#{id}")
    public void update(Emp emp);
}
